load("//tools/lint:lint.bzl", "add_lint_tests")
load(
    "//tools/performance:defs.bzl",
    "drake_cc_googlebench_binary",
    "drake_py_experiment_binary",
)

package(default_visibility = ["//visibility:public"])

drake_cc_googlebench_binary(
    name = "autodiff",
    srcs = ["autodiff.cc"],
    add_test_rule = True,
    deps = [
        "//common:add_text_logging_gflags",
        "//common/ad",
        "//tools/performance:fixture_common",
        "//tools/performance:gflags_main",
    ],
)

drake_py_experiment_binary(
    name = "autodiff_experiment",
    googlebench_binary = ":autodiff",
)

drake_cc_googlebench_binary(
    name = "benchmark_polynomial",
    srcs = ["benchmark_polynomial.cc"],
    add_test_rule = True,
    test_args = [
        # When testing, skip over Args() that are >= 100.
        "--benchmark_filter=-/.00",
    ],
    test_timeout = "moderate",
    deps = [
        "//common:add_text_logging_gflags",
        "//common/symbolic:monomial_util",
        "//common/symbolic:polynomial",
        "//tools/performance:fixture_common",
        "//tools/performance:gflags_main",
        "@fmt",
    ],
)

drake_py_experiment_binary(
    name = "polynomial_experiment",
    googlebench_binary = ":benchmark_polynomial",
)

add_lint_tests()
